{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2be57bfd",
   "metadata": {},
   "source": [
    "## Faker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "6c859295",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Faker\n",
    "from pyecharts.faker import Faker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "1233e41d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['可乐', '雪碧', '橙汁', '绿茶', '奶茶', '百威', '青岛']"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 随机产生同属性的7个名词\n",
    "Faker.choose() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "d4d321ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[36, 48, 146, 64, 48, 53, 30]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.values()  # 随机的7个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "bda678b2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['宝马', '法拉利', '奔驰', '奥迪', '大众', '丰田', '特斯拉']"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.cars  # 7个车名"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "bdc881b8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['China', 'Canada', 'Brazil', 'Russia', 'United States', 'Africa', 'Germany']"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.country  # 7个国家"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "99d9e3c9",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['#313695',\n",
       " '#4575b4',\n",
       " '#74add1',\n",
       " '#abd9e9',\n",
       " '#e0f3f8',\n",
       " '#ffffbf',\n",
       " '#fee090',\n",
       " '#fdae61',\n",
       " '#f46d43',\n",
       " '#d73027',\n",
       " '#a50026']"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.visual_color  # 颜色"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "e9e7bc1e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['0天',\n",
       " '1天',\n",
       " '2天',\n",
       " '3天',\n",
       " '4天',\n",
       " '5天',\n",
       " '6天',\n",
       " '7天',\n",
       " '8天',\n",
       " '9天',\n",
       " '10天',\n",
       " '11天',\n",
       " '12天',\n",
       " '13天',\n",
       " '14天',\n",
       " '15天',\n",
       " '16天',\n",
       " '17天',\n",
       " '18天',\n",
       " '19天',\n",
       " '20天',\n",
       " '21天',\n",
       " '22天',\n",
       " '23天',\n",
       " '24天',\n",
       " '25天',\n",
       " '26天',\n",
       " '27天',\n",
       " '28天',\n",
       " '29天']"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.days_attrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "f9b41801",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['汕头市', '汕尾市', '揭阳市', '阳江市', '肇庆市', '广州市', '惠州市']"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.days_values\n",
    "Faker.clock  # 时钟的列表\n",
    "\n",
    "Faker.animal\n",
    "Faker.dogs\n",
    "Faker.clothes\n",
    "Faker.guangdong_city"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "40317503",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['周一', '周二', '周三', '周四', '周五', '周六', '周日']"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.week"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "7ad3b926",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Saturday', 'Friday', 'Thursday', 'Wednesday', 'Tuesday', 'Monday', 'Sunday']"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.week_en"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4abcdc93",
   "metadata": {},
   "source": [
    "## 饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "a8383bd7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Pie\n",
    "import pyecharts.options as opts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "b14d2963",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['衬衫', '毛衣', '领带', '裤子', '风衣', '高跟鞋', '袜子']"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.choose()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "21a4a531",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[143, 31, 21, 29, 55, 76, 91]"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.values()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "204e3bbd",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('哈士奇', 43),\n",
       " ('萨摩耶', 94),\n",
       " ('泰迪', 33),\n",
       " ('金毛', 44),\n",
       " ('牧羊犬', 121),\n",
       " ('吉娃娃', 84),\n",
       " ('柯基', 106)]"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list( zip(Faker.choose(), Faker.values()) )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "33585f64",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['小米', 117],\n",
       " ['三星', 64],\n",
       " ['华为', 127],\n",
       " ['苹果', 133],\n",
       " ['魅族', 95],\n",
       " ['VIVO', 132],\n",
       " ['OPPO', 59]]"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[list(x)  for x in zip(Faker.choose(), Faker.values())]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "92988e25",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f50d5e60640143af8cde055d1db8aa82\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_f50d5e60640143af8cde055d1db8aa82 = echarts.init(\n",
       "                    document.getElementById('f50d5e60640143af8cde055d1db8aa82'), 'white', {renderer: 'canvas'});\n",
       "                var option_f50d5e60640143af8cde055d1db8aa82 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5c0f\\u7c73\",\n",
       "                    \"value\": 142\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e09\\u661f\",\n",
       "                    \"value\": 121\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u534e\\u4e3a\",\n",
       "                    \"value\": 64\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u82f9\\u679c\",\n",
       "                    \"value\": 33\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9b45\\u65cf\",\n",
       "                    \"value\": 77\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"VIVO\",\n",
       "                    \"value\": 73\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"OPPO\",\n",
       "                    \"value\": 150\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5c0f\\u7c73\",\n",
       "                \"\\u4e09\\u661f\",\n",
       "                \"\\u534e\\u4e3a\",\n",
       "                \"\\u82f9\\u679c\",\n",
       "                \"\\u9b45\\u65cf\",\n",
       "                \"VIVO\",\n",
       "                \"OPPO\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_f50d5e60640143af8cde055d1db8aa82.setOption(option_f50d5e60640143af8cde055d1db8aa82);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dd31cfa5b0>"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = Pie()\n",
    "c.add('', [list(x)  for x in zip(Faker.choose(), Faker.values())])\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "8bc9c28c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"44ff4d0dd0ed461e9d61a771a09836e8\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_44ff4d0dd0ed461e9d61a771a09836e8 = echarts.init(\n",
       "                    document.getElementById('44ff4d0dd0ed461e9d61a771a09836e8'), 'white', {renderer: 'canvas'});\n",
       "                var option_44ff4d0dd0ed461e9d61a771a09836e8 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"red\",\n",
       "        \"blue\",\n",
       "        \"green\",\n",
       "        \"orange\",\n",
       "        \"yellow\",\n",
       "        \"pink\",\n",
       "        \"black\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u4e00\",\n",
       "                    \"value\": 140\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u4e8c\",\n",
       "                    \"value\": 120\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u4e09\",\n",
       "                    \"value\": 25\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u56db\",\n",
       "                    \"value\": 115\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u4e94\",\n",
       "                    \"value\": 149\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u516d\",\n",
       "                    \"value\": 117\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5468\\u65e5\",\n",
       "                    \"value\": 111\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}:{c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"type\": \"scroll\",\n",
       "            \"show\": true,\n",
       "            \"left\": \"80%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u8bbe\\u7f6e\\u989c\\u8272\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_44ff4d0dd0ed461e9d61a771a09836e8.setOption(option_44ff4d0dd0ed461e9d61a771a09836e8);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dd316c18b0>"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Pie()\n",
    "    .add('', [list(x)  for x in zip(Faker.choose(), Faker.values())])\n",
    "    .set_colors(['red', 'blue', 'green', 'orange', 'yellow', 'pink', 'black'])\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title='设置颜色'),\n",
    "        legend_opts=opts.LegendOpts(type_='scroll', pos_left=\"80%\", orient='vertical')\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}:{c}\"))\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "148354cb",
   "metadata": {},
   "source": [
    "### 玫瑰图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "31cba8ff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['衬衫', '毛衣', '领带', '裤子', '风衣', '高跟鞋', '袜子']"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "v = Faker.choose()\n",
    "v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "a22fe688",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['衬衫', 101],\n",
       " ['毛衣', 70],\n",
       " ['领带', 122],\n",
       " ['裤子', 131],\n",
       " ['风衣', 26],\n",
       " ['高跟鞋', 48],\n",
       " ['袜子', 117]]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[list(i) for i in zip(v, Faker.values())]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "1e73a5ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"42e945aee4434acb95c7eba6d0c19c53\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_42e945aee4434acb95c7eba6d0c19c53 = echarts.init(\n",
       "                    document.getElementById('42e945aee4434acb95c7eba6d0c19c53'), 'white', {renderer: 'canvas'});\n",
       "                var option_42e945aee4434acb95c7eba6d0c19c53 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u886c\\u886b\",\n",
       "                    \"value\": 95\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6bdb\\u8863\",\n",
       "                    \"value\": 40\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9886\\u5e26\",\n",
       "                    \"value\": 107\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u88e4\\u5b50\",\n",
       "                    \"value\": 33\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u98ce\\u8863\",\n",
       "                    \"value\": 114\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                    \"value\": 54\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u889c\\u5b50\",\n",
       "                    \"value\": 42\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"25%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u886c\\u886b\",\n",
       "                    \"value\": 110\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6bdb\\u8863\",\n",
       "                    \"value\": 26\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9886\\u5e26\",\n",
       "                    \"value\": 69\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u88e4\\u5b50\",\n",
       "                    \"value\": 78\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u98ce\\u8863\",\n",
       "                    \"value\": 63\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                    \"value\": 77\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u889c\\u5b50\",\n",
       "                    \"value\": 110\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"20%\",\n",
       "                \"55%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"75%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"area\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u6bdb\\u8863\",\n",
       "                \"\\u9886\\u5e26\",\n",
       "                \"\\u88e4\\u5b50\",\n",
       "                \"\\u98ce\\u8863\",\n",
       "                \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                \"\\u889c\\u5b50\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u73ab\\u7470\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_42e945aee4434acb95c7eba6d0c19c53.setOption(option_42e945aee4434acb95c7eba6d0c19c53);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dd31a1bd30>"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Pie()\n",
    "    .add(\n",
    "        '',\n",
    "        [list(i) for i in zip(v, Faker.values())],\n",
    "        radius=['30%', '75%'],\n",
    "        center=['25%', '50%'],\n",
    "        rosetype='radius',\n",
    "        label_opts=opts.LabelOpts(is_show=False)  # 不显示标签\n",
    "    )\n",
    "    .add(\n",
    "        '',\n",
    "        [list(i) for i in zip(v, Faker.values())],\n",
    "        radius=['20%', '55%'],\n",
    "        center=['75%', '50%'],\n",
    "        rosetype='area',\n",
    "        label_opts=opts.LabelOpts(is_show=True)  # 显示标签\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='玫瑰图'))\n",
    ")\n",
    "c.render_notebook()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
